SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 41912: PROC FCMP returns incorrect value with character value defined with a length of 32767

DetailsAboutRate It

PROC FCMP allows a function to be defined with a character return value length of 32767 characters. Currently the resulting value is truncated to a value less than 32767 characters when the function created in PROC FCMP is called in the DATA Step. If you define the variable in PROC FCMP with the character return value of 32766 characters, the resulting value is correct when the function is called in the DATA Step. Also you may receive the following ERROR message in the SAS log when the function created by PROC FCMP is called in the DATA step:

   Internal ERROR: Character Temporary size not set

Here is an example to illustrate the problem:

   proc fcmp outlib = work.functions.string;
     function r32767(str $) $ 32767;
       String = "abcdefghijklmnopqrstuvwxyz" ; 
       return(String);
     endsub;
   run;
   
   options cmplib=(work.functions);

   data work.test1 ; 
     r3 = r32767('r3') ;
   run;

By changing the length on the FUNCTIONS statement after the $ in PROC FCMP from 32767 to 32766, you will receive the entire string.



Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemBase SASz/OS9.2 TS2M29.3 TS1M0
Microsoft® Windows® for 64-Bit Itanium-based Systems9.2 TS2M29.3 TS1M0
Microsoft Windows Server 2003 Datacenter 64-bit Edition9.2 TS2M29.3 TS1M0
Microsoft Windows Server 2003 Enterprise 64-bit Edition9.2 TS2M29.3 TS1M0
Microsoft Windows XP 64-bit Edition9.2 TS2M29.3 TS1M0
Microsoft® Windows® for x649.2 TS2M29.3 TS1M0
Microsoft Windows Server 2003 Datacenter Edition9.2 TS2M29.3 TS1M0
Microsoft Windows Server 2003 Enterprise Edition9.2 TS2M29.3 TS1M0
Microsoft Windows Server 2003 Standard Edition9.2 TS2M29.3 TS1M0
Microsoft Windows Server 2003 for x649.2 TS2M29.3 TS1M0
Microsoft Windows Server 20089.2 TS2M29.3 TS1M0
Microsoft Windows Server 2008 for x649.2 TS2M29.3 TS1M0
Microsoft Windows XP Professional9.2 TS2M29.3 TS1M0
Windows 7 Enterprise 32 bit9.2 TS2M29.3 TS1M0
Windows 7 Enterprise x649.2 TS2M29.3 TS1M0
Windows 7 Home Premium 32 bit9.2 TS2M29.3 TS1M0
Windows 7 Home Premium x649.2 TS2M29.3 TS1M0
Windows 7 Professional 32 bit9.2 TS2M29.3 TS1M0
Windows 7 Professional x649.2 TS2M29.3 TS1M0
Windows 7 Ultimate 32 bit9.2 TS2M29.3 TS1M0
Windows 7 Ultimate x649.2 TS2M29.3 TS1M0
Windows Vista9.2 TS2M29.3 TS1M0
Windows Vista for x649.2 TS2M29.3 TS1M0
64-bit Enabled AIX9.2 TS2M29.3 TS1M0
64-bit Enabled HP-UX9.2 TS2M29.3 TS1M0
64-bit Enabled Solaris9.2 TS2M29.3 TS1M0
HP-UX IPF9.2 TS2M29.3 TS1M0
Linux9.2 TS2M29.3 TS1M0
Linux for x649.2 TS2M29.3 TS1M0
OpenVMS on HP Integrity9.2 TS2M29.3 TS1M0
Solaris for x649.2 TS2M29.3 TS1M0
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.